package test.test_6_29;
/*
完成一个图案（Shape）的体系设计。先定义一个抽象类Shape类，
然后通过继承来定义一些具体的形状类，如Rectangle和Circle。
抽象类Shape只需要给出两个抽象方法：求周长的抽象方法和求面积的抽象方法。
 */
public class Demo {
    public static void main(String[] args) {

    }
}
abstract class Shape {
    public abstract void Rectangle();
    public abstract void Circle();

    public Shape() {
    }
}
class Square extends Shape {
    int length;

    @Override
    public  void Rectangle() {
        System.out.println(length * 4);
    }

    @Override
    public void Circle() {
        System.out.println(length * length);
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public Square() {
        super();
    }
}
class Rectangle extends Shape{
    int length;

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }


    public Rectangle() {
    }

    public Rectangle(int length) {
        this.length = length;
    }

    int width;
    @Override
    public void Rectangle() {
        System.out.println(length);
    }

    @Override
    public void Circle() {

    }
}
